﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class download : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(Server.MapPath("~/Download/"));
        System.IO.FileStream fs = new System.IO.FileStream(Server.MapPath("~/Download") + "/downloads.txt", System.IO.FileMode.Open);
        System.IO.StreamReader sr = new System.IO.StreamReader(fs);
		
        while (!sr.EndOfStream)
        {
            HyperLink hl = new HyperLink();
            hl.Text = sr.ReadLine();
            hl.NavigateUrl = sr.ReadLine();
			pnlFiles.Controls.Add(hl);
			Label lb = new Label();
            lb.Text = "<br>";
			pnlFiles.Controls.Add(lb);
        }

        sr.Close();
        fs.Close();
            //hl.NavigateUrl = fi.Name;
            //if(!hl.Text.Contains("default"))
            //    pnlFiles.Controls.Add(hl);
            //Label lb = new Label();
            //lb.Text = "<br>";
            //if(!hl.Text.Contains("default"))
            //    pnlFiles.Controls.Add(lb);
    }
}
